#include <bits/stdc++.h>
using namespace std;
#include <atcoder/modint>
using namespace atcoder;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;

using mint = atcoder::modint;
int n, m, h, p;
mint dp[16][16][16][436], c[31][31], f[16][16][436];

void init_c() {
  c[0][0] = 1;
  rep(i, 0, n - 1) rep(j, 0, i) c[i + 1][j] += c[i][j],
      c[i + 1][j + 1] += c[i][j];
}
void init_f() {
  rep(i, 1, h) {
    f[i][0][0] = 1;
    rep(j, 0, h - 1) rep(s, 1, i) rep(t, 0, j) rep(k, 0, m - s - t) {
      f[i][j + 1][k + s + t] += f[i][j][k] * c[i][s] * c[j][t];
    }
  }
}

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> p;
  mint::set_mod(p);
  m = n * (n - 1) / 2, h = n / 2;
  init_c();
  init_f();
  dp[1][0][1][0] = 1;
  rep(tot, 1, n) rep(i, 1, h) rep(k, 1, i) rep(e, 0, m) {
    int j = tot - i;
    if (j > h) continue;
    // k prev layer vertice's cnt
    // i sum of vertices's cnt in layers which oddness is the same with k
    // j sum of vertices's cnt in layers which oddness is different with k
    // e edge's cnt
    mint s = dp[i][j][k][e];
    if (s == 0) continue;
    rep(k1, 1, h - j) rep(e1, k1, m - e) {
      dp[j + k1][i][k1][e + e1] += s * c[n - i - j][k1] * f[k][k1][e1];
    }
  }
  rep(e, n - 1, m) {
    mint ans = 0;
    rep(k, 1, h) ans += dp[h][h][k][e];
    cout << ans.val() << ' ';
  }
  return 0;
}